import {Base} from '../../utils/base.js'

class Category extends Base
{
  constructor(){
    super()
  }

  getAllCategory(callback){
    let params = {
      "url": 'category/all',
      "sCallBack": function (data) {
        callback && callback(data)
      }
    }

    this.request(params)
  }

  getProductsByCateId(id, callback){
    let params = {
      "url": 'product/by_category?id='+id,
      "sCallBack": function (data) {
        callback && callback(data)
      }
    }

    this.request(params)
  }
}

export {Category}